package com.wolfstreet.wsonline.util;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

import com.wolfstreet.wsonline.R;

/**
 * 对话框工具类
 * 
 * @author sy
 * 
 */
public class DialogUtil {

	/**
	 * 显示退出对话框
	 * 
	 * @param act
	 * @param listener
	 */
	public static void showExitDialog(Activity act, OnClickListener listener) {
		AlertDialog dia = new AlertDialog.Builder(act)
				.setTitle(R.string.exit_title)
				.setMessage(R.string.exit_message)
				.setPositiveButton(R.string.sure, listener)
				.setNegativeButton(R.string.cancle, new OnClickListener() {

					@Override
					public void onClick(DialogInterface dialog, int which) {
						// TODO Auto-generated method stub
						dialog.dismiss();
					}
				}).create();
		dia.show();
	}

}
